package golf.simulation.dataobject;

import java.util.ArrayList;
import java.util.UUID;

public class InvestmentItem {
	
	private ArrayList<Transaction> transList = new ArrayList<Transaction>();
	private int forceIdle = 0;
	private boolean firstTime = true;
	private boolean discontinued = false;
	private Transaction currentTransaction;
	private double marginCostOfCurrentTransaction;
	
	private String uuid;
	
	public boolean isDiscontinued(){
		return this.discontinued;
	}
	
	public void discontinued(){
		this.discontinued = true;
	}
	
	public InvestmentItem(){
		UUID x = UUID.randomUUID();
		this.uuid = x.toString();
	}
	
	public String getUUID(){
		return this.uuid;
	}
	
	public Transaction getTransaction(int i){
		return transList.get(i);
	}
	
	public void addTransaction(Transaction t){
		this.transList.add(t);
	}
	
	public ArrayList<Transaction> getTransactionList(){
		return this.transList;
	}
	
	public void setTransactionList(ArrayList<Transaction> t){
		this.transList = t;
	}
	
	public int getForceIdle(){
		return forceIdle;
	}
	
	public void setForceIdle(int f){
		this.forceIdle = f;
	}
	
	public void deductForceIdle(){
		this.forceIdle--;
	}
	
	public boolean isFirstTime(){
		return firstTime;
	}
	
	public void setFirstTime(boolean f){
		this.firstTime = f;
	}

	public Transaction getCurrentTransaction() {
		return currentTransaction;
	}

	public void setCurrentTransaction(Transaction currentTransaction) {
		this.currentTransaction = currentTransaction;
	}
	
	public Transaction getLatestTransaction(){
		return this.transList.get(transList.size() - 1);
	}

	public double getMarginCostOfCurrentTransaction() {
		return marginCostOfCurrentTransaction;
	}

	public void setMarginCostOfCurrentTransaction(
			double marginCostOfCurrentTransaction) {
		this.marginCostOfCurrentTransaction = marginCostOfCurrentTransaction;
	}

}
